package com.example.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mybatisplus.pojo.More;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

@Mapper
public interface MoreMapper extends BaseMapper<More> {
    @Results(id = "moreResultMap",value = {
            @Result(id = true,column = "more_id",property = "id"),
            @Result(column = "more_name",property = "moreName"),
            @Result(column = "more_create_time",property = "moreCreateTime"),
            @Result(column = "one_id",property = "one",
                    one = @One(select = "com.example.mybatisplus.mapper.OneMapper.selectById",fetchType = FetchType.LAZY))
    })
    @Select("select * from more where one_id=#{oneId}")
    public List<More> selectByOneId(Long oneId);



}
